﻿@{
    Layout = null;
    Sysconfig config = ViewData["config"] as Sysconfig;
    Userconfig uconfig = ViewData["uconfig"] as Userconfig;
    string action = ViewBag.Action as string;
}
<!DOCTYPE html>
<!--HTML5 doctype-->
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>找回密码</title>
    <link rel="stylesheet" type="text/css" href="/mobile/css/validate.css" />
    <link rel="stylesheet" type="text/css" href="/mobile/css/style.css" />
    <script type="text/javascript" charset="utf-8" src="/mobile/js/zepto.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/weui.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/common.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/mvalidate.js"></script>
    <script type="text/javascript" charset="utf-8" src="/mobile/js/mvalidate-extend.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/mobile/js/register-validate.js"></script>
</head>

<body ontouchstart>
    <div class="page">
        <!--页面头部-->
        <div class="header">
            <a class="back" href="javascript:history.back();">
                <i class="iconfont icon-arrow-left"></i>
            </a>
            <h3>密码找回</h3>
            <div class="right">
                <a class="weui-cell_access weui-cell_link" asp-area="Web" asp-controller="Index" asp-action="Index">
                    <i class="iconfont icon-home"></i>
                </a>
            </div>
        </div>
        <!--/页面头部-->
        <!--页面内容-->
        <div class="page__bd">

            @if (action=="index")
            {
                <script type="text/javascript">
                    $(function () {
                        //初始化表单
                        AjaxInitForm('#pwdForm', '#btnSubmit', 1);
                    });
                </script>
                <!--取回密码-->
                <form id="pwdForm" name="pwdForm" url="/submit_ajax?action=user_getpassword">
                    <div class="weui-cells weui-cells_form">
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">账户名</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtUserName" name="txtUserName" type="text" class="weui-input" placeholder="输入登录用户名" data-validate="username" />
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">取回方式</label>
                            </div>
                            <div class="weui-cell__bd">
                                <label style="margin-right:10px;"><input name="txtType" type="radio" value="mobile" checked="checked" />手机短信</label>
                                <label style="margin-right:10px;"><input name="txtType" type="radio" value="email" />电子邮箱</label>
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">验证码</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtCode" name="txtCode" class="weui-input" type="text" placeholder="请输入验证码" data-validate="code" />
                            </div>
                            <div class="weui-cell__ft">
                                <a href="javascript:;" onclick="ToggleCode(this, '/verify_code/index');return false;">
                                    <img class="weui-vcode-img" src="/verify_code/index" style="width:82px;height:24px;" />
                                </a>
                            </div>
                        </div>
                    </div>
                    <div class="weui-btn-area">
                        <input id="btnSubmit" name="btnSubmit" type="submit" class="weui-btn weui-btn_primary" value="立即找回" />
                    </div>
                </form>
                <!--/取回密码-->
            }
            else if (action == "mobile")
            {
                <script type="text/javascript">
                    $(function () {
                        //初始化表单
                        AjaxInitForm('#pwdForm', '#btnSubmit', 1);
                    });
                </script>
                <!--手机取回密码-->
                <form id="pwdForm" name="pwdForm" url="/submit_ajax?action=user_repassword">
                    <div class="weui-cells weui-cells_form">
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">用户名</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtTelphone" name="hideCode" type="text" class="weui-input" placeholder="输入您手机收到的验证码" data-validate="username" />
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">新密码</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtPassword" name="txtPassword" type="password" class="weui-input" placeholder="请输入密码" data-validate="password" />
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">确认新密码</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtPassword1" name="txtPassword1" type="password" class="weui-input" placeholder="请再次输入密码" data-required="true" data-descriptions="confirmpassword" data-conditional="confirmpwd" />
                            </div>
                        </div>
                    </div>
                    <div class="weui-btn-area">
                        <input id="btnSubmit" name="btnSubmit" type="submit" class="weui-btn weui-btn_primary" value="确认修改" />
                    </div>
                </form>
                <!--/手机取回密码-->
            }
            else if (action == "email")
            {
                <script type="text/javascript">
                    $(function () {
                        //初始化表单
                        AjaxInitForm('#pwdForm', '#btnSubmit', 1);
                    });
                </script>
                <!--邮箱取回密码-->
                <form id="pwdForm" name="pwdForm" url="/submit_ajax?action=user_repassword">
                    <div class="weui-cells weui-cells_form">
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">用户名</label>
                            </div>
                            <div class="weui-cell__bd">
                                @ViewBag.username
                                <input name="hideCode" type="hidden" value="@ViewBag.code" />
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">新密码</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtPassword" name="txtPassword" type="password" class="weui-input" placeholder="请输入密码" data-validate="password" />
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd">
                                <label class="weui-label">确认新密码</label>
                            </div>
                            <div class="weui-cell__bd">
                                <input id="txtPassword1" name="txtPassword1" type="password" class="weui-input" placeholder="请再次输入密码" data-required="true" data-descriptions="confirmpassword" data-conditional="confirmpwd" />
                            </div>
                        </div>
                    </div>
                    <div class="weui-btn-area">
                        <input id="btnSubmit" name="btnSubmit" type="submit" class="weui-btn weui-btn_primary" value="确认修改" />
                    </div>
                </form>
                <!--/ 邮箱取回密码-->
            }

            @if (action == "error")
            {
                <!--错误界面-->
                <div class="weui-msg msg-box">
                    <div class="weui-msg__icon-area">
                        <i class="weui-icon-warn weui-icon_msg"></i>
                    </div>
                    <div class="weui-msg__text-area">
                        <h2 class="weui-msg__title">修改验证失败</h2>
                        <p class="weui-msg__desc">
                            无法验证你的账户，可能是你的用户名不存在或者验证码已经过期！
                        </p>
                    </div>
                    <div class="weui-msg__opr-area">
                        <p class="weui-btn-area">
                            <a class="weui-btn weui-btn_primary" asp-area="Web" asp-controller="Index" asp-action="Index">返回首页</a>
                        </p>
                    </div>
                </div>
                <!--/错误界面-->
            }

            <!--版权信息-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Copyright.cshtml")
            <!--/版权信息-->
            <!--底部导航-->
            @await Html.PartialAsync("~/Areas/Web/Views/Shared/_Footer.cshtml")
            <!--/底部导航-->

        </div>
        <!--/页面内容-->

    </div>
</body>
</html>
